package com.yyplatform.admin.platform.notice.model.enums;

import com.yyplatform.admin.infra.model.enums.OptionEnum;

/**
 * @author sleepforests@163.com
 * <p>
 * Created on 2024/9/17 13:56
 */
public enum NoticeTypeEnum implements OptionEnum<Integer> {


    TYPE_ANNOUNCEMENT(1, "公告"),
    TYPE_MEETING(2, "会议"),
    TYPE_OTHER(99, "其他"),
    //
    ;


    private Integer type;
    private String label;


    NoticeTypeEnum(Integer type, String ll) {
        this.type = type;
        this.label = ll;
    }

    public static NoticeTypeEnum of(Integer type) {
        for (NoticeTypeEnum e : values()) {
            if (e.type.equals(type)) {
                return e;
            }
        }
        throw new IllegalArgumentException("invalid type: " + type);
    }


    @Override
    public Integer getValue() {
        return type;
    }

    @Override
    public String getLabel() {
        return label;
    }
}
